package com.foton.lotterydomain.activity.repository;

import com.foton.lotterydomain.activity.model.vo.DrawOrderVO;
import com.foton.lotterydomain.activity.model.vo.UserTakeActivityVO;

import java.util.Date;

/**
 * @Author RenPu
 * @Date 2024/1/2 17:01
 * @Version 1.0
 * @Description:
 **/
public interface IUserTakeActivityRepository {
    /**
     * 扣减个人活动参与次数
     *
     * @param activityId        活动ID
     * @param activityName      活动名称
     * @param takeCount         活动个人可领取次数
     * @param userTakeLeftCount 活动个人剩余领取次数
     * @param uId               用户ID
     * @param partakeDate       领取时间
     * @return                  更新结果
     */
    int subtractionLeftCount(Long activityId, String activityName, Integer takeCount, Integer userTakeLeftCount, String uId, Date partakeDate);

    /**
     * 领取活动
     *
     * @param activityId        活动ID
     * @param activityName      活动名称
     * @param takeCount         活动个人可领取次数
     * @param userTakeLeftCount 活动个人剩余领取次数
     * @param uId               用户ID
     * @param takeDate          领取时间
     * @param takeId            领取ID
     */
    void takeActivity(Long activityId, String activityName, Integer takeCount, Integer userTakeLeftCount, String uId, Date takeDate, Long takeId);


    /**
     * 根据用户ID和活动ID查询已经领取的活动单，没有进行参与
     * @param acvityId
     * @param uId
     */
    UserTakeActivityVO queryNoConsumedTakeActivityOrder(Long acvityId, String uId);


    /**
     * 尝试锁定活动领取记录
     * @param userTakeActivity
     * @return
     */
    int lockTackActivity(String uId, Long activityId, Long takeId);

    void saveUserStrategyExport(DrawOrderVO drawOrder);


    /**
     * 根据用户ID orderId,更改MQ消息状态值
     * @param uId
     * @param orderId
     * @param mqState
     */
    void updateInvoiceMqState(String uId, Long orderId, Integer mqState);
}
